layui.use('table', function(){
    var $  = layui.jquery;
    var table = layui.table;
    var create=parse("user");//从localStorage里取值
    var mid=create.user_id;
    getLoginLog(mid);
    function getLoginLog(mid){
        $.ajax({
            url:"/login/selLoginLogs",
            type:"post",
            dataTypr:"json",
            data:{"mid":mid},
            success:function (data){
                LoginLogTable(data.data);
            }
        })
    }
    function LoginLogTable(data){
        table.render({
            elem: '#log'
            ,data:data
            ,page:true
            ,cols: [[
                {field:'login_date', title: '登陆时间',align:'center',templet : function(d) {
                        return renderTime(d.login_date);
                    }}
                ,{field:'login_ip', title: '登录IP',align:'center'}
                ,{field:'login_location', title: '登陆地区',align:'center'}
            ]]
        });
    }
});